package com.jinyang.jetpackdemo.paging3

import androidx.paging.PagingSource
import androidx.room.*

/**
 * @Author:         LiuJinYang
 * @CreateDate:     2021/8/18
 * @Description:
 */
@Dao
interface RepoDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insert(pokemonList: List<RepoEntity>)

    @Query("SELECT * FROM RepoEntity")
    fun get(): PagingSource<Int, RepoEntity>

    @Query("DELETE FROM RepoEntity")
    fun clear()

    @Delete
    fun delete(repo: RepoEntity)

    @Update
    fun update(repo: RepoEntity)
}